import { pubRequire } from '@utils/public'
const baseUrl = '/tags'
//获取列表
export function getTagList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
//批量删除
export function multipleDel(obj, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}`, obj, callBack, errBack)
}
//单个删除
export function singleDel(id, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callBack, errBack)
}
//获取标签分类下的用户数量
export function getUserCount(id, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}/count`, '', callBack, errBack)
}
//改变状态,启用/停用
export function changeStatus(id, status, callBack, errBack) {
  let url = `${baseUrl}/${id}/`
  let str = status ? 'enable' : 'disable'
  url += str
  return pubRequire('put', url, '', callBack, errBack)
}
//创建标签-提交表单-手动导入
export function handImport(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
//创建标签-提交表单-批量导入
export function multipleImport(formData, callBack, errBack) {
  return pubRequire('post', `${baseUrl}/import`, formData, callBack, errBack)
}
//创建标签-下载标签模板接口
export function downTagUrl() {
  return `${baseUrl}/download`
}
//用户标签管理-查看标签-删除
export function delCheckTag(obj, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/user`, obj, callBack, errBack)
}
